<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        th,td{
            width: 200px;
            border: 1px solid black;
        }
        tbody tr{
            background-image:linear-gradient(to right,skyblue,green) ;
        }
        tbody tr:hover{
            background-image:linear-gradient(to right,green,yellow) ;
        }
        thead tr{
            background-image:linear-gradient(to top,red,orange) ;

        }
    </style>
</head>

<body>
    <table>
        <thead>
            <tr>
                <th>姓名</th>
                <th>身份</th>
                <th>资质</th>
            </tr>
        </thead>
        <tbody>

        </tbody>
    </table>
</body>

</html>
<script>
    var arr = [
        {
            'xm': '古月方源',
            'sf': '蛊修',
            'zz': '丙等'
        },
        {
            'xm': '白凝冰',
            'sf': '蛊修',
            'zz': '十绝天资'
        }, 
        {
            'xm': '古月方正',
            'sf': '蛊修',
            'zz': '甲等'
        }, 
        {
            'xm': '小熊饼干',
            'sf': '蛊修',
            'zz': '乙等'
        },
    ]
    var tb=document.querySelector("tbody")
    for(i=0;i<arr.length;i++){
        //创建
        var tr=document.createElement("tr")
        //赋值
        tr.innerHTML=`
                <td>${arr[i]['xm']}</td>
                <td>${arr[i]['sf']}</td>
                <td>${arr[i]['zz']}</td>
        `;
        //添加
        tb.appendChild(tr)
    }
</script>